FROM openjdk:11

MAINTAINER zhangmin <cisolzhang@tencent.com>

RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone


RUN mkdir -p /data/app/
RUN mkdir -p /data/logs/

ENV JAVA_OPTS="-server -Xmx512m -Xms512m -Xss256m -XX:MaxDirectMemorySize=256m \
-XX:+UseG1GC -verbose:gc -XX:+PrintCommandLineFlags -XX:+ExplicitGCInvokesConcurrent \
-Xlog:gc*,safepoint:/data/logs/gc.log:time,uptime:filecount=100,filesize=50M \
-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/data/logs/oom.dump"

COPY docker /docker
ADD target/*-app.jar /data/app/
EXPOSE 8080

#ENTRYPOINT java ${JAVA_OPTS} -jar /data/app/authcenter-server/authcenter-server-0.0.1-SNAPSHOT.jar --spring.config.location=/data/config/authcenter-server/application.yml
#ENTRYPOINT exec java $JAVA_OPTS -Dapp.id=$APP_ID \
# -javaagent:/skywalking/agent/skywalking-agent.jar \
# -Dskywalking.agent.service_name=$APP_ID \
# -Dskywalking.collector.backend_service=$SKYWALKING_ADDR \
# -jar /data/app/fdt-gateway-internal/fdt-gateway-internal-1.0.1-SNAPSHOT.jar --spring.config.location=/data/config/authcenter-server/application.yml
WORKDIR /data/app/
RUN chmod +x /docker/docker-entrypoint.sh
ENTRYPOINT ["/docker/docker-entrypoint.sh"]
